From: Florian Müllner Date: Mon, 29 Jan 2024 16:41:54 +0000 (+0100) Subject: boxpointer: Swap arrow alignment on RTL X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~281^2~2^2~80 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=4e70315fbb7a4ee88bd5ce1d789d6735da450975;p=gnome-shell.git boxpointer: Swap arrow alignment on RTL The current code uses the arrow alignment to align the menu between the top/left (0) and bottom/right(1), regardless of the text direction. Instead of adjusting code everywhere, reinterpret the parameter to refer to start/end instead, and swap the alignment with an RTL text direction. Credit to Sebastian Keller for spotting the cause of the issue. Close https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/5261 Close https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/7356 Part-of: --- diff --git a/js/ui/boxpointer.js b/js/ui/boxpointer.js index 53433245d..8c410201e 100644 --- a/js/ui/boxpointer.js +++ b/js/ui/boxpointer.js @@ -533,6 +533,9 @@ export const BoxPointer = GObject.registerClass({ switch (this._arrowSide) { case St.Side.TOP: case St.Side.BOTTOM: + if (this.text_direction === Clutter.TextDirection.RTL) + alignment = 1.0 - alignment; + resX = sourceCenterX - (halfMargin + (natWidth - margin) * alignment); resX = Math.max(resX, workarea.x + padding);